# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=proxybroker
pkgver=152.d21aae8
pkgrel=8
pkgdesc='Proxy [Finder | Checker | Server]. HTTP(S) & SOCKS.'
groups=('blackarch' 'blackarch-proxy' 'blackarch-scanner')
arch=('any')
url='https://github.com/constverum/ProxyBroker'
license=('Apache')
depends=('python' 'python-aiohttp' 'python-aiodns' 'python-attrs'
         'python-maxminddb')
makedepends=('git' 'python-setuptools' 'python-wheel' 'python-pip'
             'python-pytest-runner')
source=("$pkgname::git+https://github.com/constverum/ProxyBroker.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

prepare() {
  cd $pkgname

  sed -i 's|attrs==19.1.0|attrs|g' setup.py
  sed -i 's|attrs==19.1.0|attrs|g' requirements/base.txt
}

build() {
  cd $pkgname

  python setup.py build
}

package() {
  cd $pkgname

  python setup.py install --root="$pkgdir" --prefix=/usr -O1

  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.rst
}

